﻿<div class="modal-header">
    <h3 class="modal-title">选择食材信息</h3>
</div>
<div class="modal-body">
    <div class="row">
        <form class="form-horizontal">
            <div class="col-lg-6 clear-padding">
                <div class="col-lg-4 clear-padding">
                    <select class="form-control" ng-model="type" required ng-options="choose.Val as choose.Name for choose in categories">
                        <option value="">所有相关</option>
                    </select>
                </div>
                <div ce-enter="search" class="input-group">
                    <input type="text" class="form-control" ng-model="Name">
                    <span class="input-group-btn">
                        <button class="btn btn-default" ng-click="search(false)" type="button">搜索</button>
                    </span>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th class="col-lg-1">选择</th>
                    <th>名称</th>
                    <th class="col-lg-2">食材类型</th>
                    <th class="col-lg-2">单价</th>
                    <th class="col-lg-2">市场价</th>
                </tr>
            </thead>
            <tbody ng-show="!loadingState">
                <tr ng-repeat="item in list" ng-click="click(item)">
                    <!--加载食材列表-->
                    <td><input type="checkbox" ng-disabled="item.isDisabled" ng-checked="item.isChecked" /></td>
                    <td>{{item.Name}}</td>
                    <td>{{item.Category|enumVals:'MaterialCategory'}}</td>
                    <td>{{item.Price|currency:'¥'}}/{{item.Unit|enumVals:'Unit'}}</td>
                    <td>{{item.MaketPrice|currency:'¥'}}/{{item.Unit|enumVals:'Unit'}}</td>
                </tr>
            </tbody>
            <tbody ng-if="loadingState">
                <tr>
                    <td colspan="8" class="text-center">
                        <img width="60" src="/App/images/loading.gif" />
                    </td>
                </tr>
            </tbody>
            <tfoot ng-show="!loadingState">
                <tr>
                    <td colspan="8">
                        <div class="pull-right">
                            <uib-pagination boundary-links="true" total-items="total" ng-model="current" max-size="10" ng-change="search(true)" items-per-page="10" class="pagination-sm"
                                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</div>
<div class="modal-footer">
    <button type="button" ng-click="cancel()" class="btn btn-danger ">取消</button>
    <button type="button" ng-click="close()" class="btn btn-success ">确定</button>
</div>